<?php defined('SYSPATH') OR die('No direct access allowed.');

abstract class Crud_Controller extends Controller {

	public $itens_por_pagina = 10;
	
	public function __construct(){
		parent::__construct(); // This must be included
		// Load sessions, to support logins
		$this->session= Session::instance();
		$auth = new Auth;
		if (!$auth->logged_in()){
			$this->session->set("requested_url","/".url::current()); // this will redirect from the login page back to this page/
			url::redirect('auth');
		}
		$this->create_view();
	}

	abstract public function index();

	abstract public function listar();

	abstract public function criar();

	abstract public function salvar();

	abstract public function editar();

	abstract public function deletar();
	
	abstract public function ver();

} // End Template_Controller